package rifa.components;

import java.io.IOException;

import javax.faces.component.FacesComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;

@FacesComponent("rifa.components.TextoComum")
public class TextoComum extends UIComponentBase{

	public static final String COMPONENT_FAMILY = "test.components";
	
	 @Override
	    public void encodeBegin(FacesContext context) throws IOException {
	        ResponseWriter writer = context.getResponseWriter();
	        String clientId = getClientId(context);
	        String valor = (String) getAttributes().get("valor");
	        writer.startElement("span", this);
	        writer.writeAttribute("id", clientId, "id");
	        writer.write(valor);  
	        writer.endElement("span");
	    }
	
	@Override
	public String getFamily() {
		// TODO Auto-generated method stub
		return COMPONENT_FAMILY;
	}

}
